package com.runlooker.runer.util;

import android.app.Activity;
import android.app.Service;
import android.os.Vibrator;

/**
 * 
 * 手机震动工具
 * 
 * @author YINENG
 *
 */
public class TipHelper {
	public static void Vibrate(final Activity activity, long milliseconds) {
		Vibrator vib = (Vibrator) activity
				.getSystemService(Service.VIBRATOR_SERVICE);
		vib.vibrate(milliseconds);
	}

	public static void Vibrate(final Activity activity, long[] pattern,
			boolean isRepeat) {
		Vibrator vib = (Vibrator) activity
				.getSystemService(Service.VIBRATOR_SERVICE);
		vib.vibrate(pattern, isRepeat ? 1 : -1);
	}
}